package com.itheima.day08.myHashSet.test2;

import java.util.LinkedList;

public class Test extends Object {
    public static void main(String[] args) {
        Student s1 = new Student("张三",23);
        Student s2 = new Student("张三",23);
        Student s3 = new Student("张李四",23);
/*
        重写hashCode()前，底层是对对象的的地址值进行计算得出
        System.out.println(s1.hashCode()); // 764977973
        System.out.println(s1.hashCode()); // 764977973
        System.out.println(s2.hashCode()); // 381259350
        System.out.println(s3.hashCode()); // 2129789493

 */

        // 重写hashCode()后，底层是以对象存入数据的值进行计算得出
        System.out.println(s1.hashCode()); // 24021582
        System.out.println(s1.hashCode()); // 24021582
        System.out.println(s2.hashCode()); // 24021582
        System.out.println(s3.hashCode()); // 751574346


    }

}
